﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BlazorOrdering.Core;

namespace BlazorOrdering.Application
{

    public interface IOrderService
    {
        /// <summary>
        /// 保存一个订单
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        string AddOneOrder(BlazorOrdering.Core.Order order);

        /// <summary>
        /// 根据用户名返回可以退订的订单列表
        /// </summary>
        /// <param name="username">用户名</param>
        /// <returns></returns>
        Task<List<Order>> GetOnesCanCancelOrdersAsync(string username);

        /// <summary>
        /// 取消一个订单
        /// </summary>
        /// <param name="order">订单</param>
        /// <returns></returns>
        Task<string> CancelOrdersAsync(Order order);

    }
}
